package com.zb.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zb.entity.ZjWorkHoubanYunRelation;
import com.zb.mapper.ZjWorkHoubanYunRelationMapper;
import com.zb.service.ZjWorkHoubanYunRelationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 工单伙伴云关联表 服务实现类
 * </p>
 *
 * @author WEN
 * @since 2024-08-25
 */
@Service
public class ZjWorkHoubanYunRelationServiceImpl extends ServiceImpl<ZjWorkHoubanYunRelationMapper, ZjWorkHoubanYunRelation> implements ZjWorkHoubanYunRelationService {
    @Resource
    private ZjWorkHoubanYunRelationMapper workHoubanYunRelationMapper;

    // 根据乐开的ItemId获取关联工单的数据
    @Override
    public ZjWorkHoubanYunRelation getByItemId(String itemId) {
        return workHoubanYunRelationMapper.getByItemId(itemId);
    }

    // 判断是否乐开的工单
    @Override
    public boolean isLaikaiOrder(Long workId) {
        ZjWorkHoubanYunRelation relation = this.getById(workId);
        return null != relation;
    }
}
